package io.wins.vertx.entity;

import io.vertx.codegen.annotations.DataObject;
import io.vertx.core.json.JsonObject;
import io.wins.vertx.utils.UUIDUtils;
import org.apache.commons.lang3.StringUtils;

@DataObject(generateConverter = true)
public class Seat {
    private final String id;
    private String name;
    private int rows;
    private int columns;
    private String maps;
    private String legend;
    private String seats;
    private String unavailables;
    private boolean isDelete;
    private long createdOn;
    private long updatedOn;

    public Seat(final JsonObject json) {
        SeatConverter.fromJson(json, this);
        this.id = StringUtils.isEmpty(json.getString("id")) ?
            UUIDUtils.genId() : json.getString("id");
    }

    public JsonObject toJson() {
        final JsonObject json = new JsonObject();
        SeatConverter.toJson(this, json);
        return json;
    }

    public String getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public int getRows() {
        return this.rows;
    }

    public void setRows(final int rows) {
        this.rows = rows;
    }

    public int getColumns() {
        return this.columns;
    }

    public void setColumns(final int columns) {
        this.columns = columns;
    }

    public String getMaps() {
        return this.maps;
    }

    public void setMaps(final String maps) {
        this.maps = maps;
    }

    public String getLegend() {
        return this.legend;
    }

    public void setLegend(final String legend) {
        this.legend = legend;
    }

    public String getSeats() {
        return this.seats;
    }

    public void setSeats(final String seats) {
        this.seats = seats;
    }

    public String getUnavailables() {
        return this.unavailables;
    }

    public void setUnavailables(final String unavailables) {
        this.unavailables = unavailables;
    }

    public boolean isDelete() {
        return this.isDelete;
    }

    public void setDelete(final boolean delete) {
        this.isDelete = delete;
    }

    public long getCreatedOn() {
        return this.createdOn;
    }

    public void setCreatedOn(final long createdOn) {
        this.createdOn = createdOn;
    }

    public long getUpdatedOn() {
        return this.updatedOn;
    }

    public void setUpdatedOn(final long updatedOn) {
        this.updatedOn = updatedOn;
    }
}
